package models;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * @author luong
 * this entity is mapped to the Doc table
 */
@Entity 
@Table (name="Doc")
public class HibernateDocument implements Serializable{
	private static final long serialVersionUID = 1L;
	
	@Id @GeneratedValue
	@Column (name = "DOC_ID")
	private int doc_id;
	
	@Column (name = "nom")
	private String nom;
	
	@OneToMany (cascade = CascadeType.REFRESH)
	@JoinColumn(name="CONTAINER")
	private Set <HibernateTags> tagList;

	public HibernateDocument() {}

	public int getId() {
		return doc_id;
	}

	public void setId(int id) {
		this.doc_id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public Set<HibernateTags> getTagList() {
		return tagList;
	}

	public void setTagList(Set<HibernateTags> tagList) {
		this.tagList = tagList;
	}
	
}
